<%@ page import="com.storeselector.storemanagement.Product" %>



<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="product.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="name" required="" value="${productInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'sku', 'error')} ">
	<label for="sku">
		<g:message code="product.sku.label" default="Sku" />
		
	</label>
	<g:textField name="sku" value="${productInstance?.sku}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'price', 'error')} required">
	<label for="price">
		<g:message code="product.price.label" default="Price" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="price" required="" value="${fieldValue(bean: productInstance, field: 'price')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'salePrice', 'error')} required">
	<label for="salePrice">
		<g:message code="product.salePrice.label" default="Sale Price" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="salePrice" required="" value="${fieldValue(bean: productInstance, field: 'salePrice')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'salePriceExpiration', 'error')} ">
	<label for="salePriceExpiration">
		<g:message code="product.salePriceExpiration.label" default="Sale Price Expiration" />
		
	</label>
	<g:datePicker name="salePriceExpiration" precision="day"  value="${productInstance?.salePriceExpiration}" default="none" noSelection="['': '']" />
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'description', 'error')} ">
	<label for="description">
		<g:message code="product.description.label" default="Description" />
		
	</label>
	<g:textField name="description" value="${productInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: productInstance, field: 'store', 'error')} required">
	<label for="store">
		<g:message code="product.store.label" default="Store" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField id="store" disabled="true" name="store.id" value="${com.storeselector.storemanagement.Store.get(params.storeId).name}"/>
	<g:hiddenField name="store.id" value="${params.storeId}"/>	
</div>

